<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Itinerary extends Model
{
    protected $guarded = [];
    public static function getLine($scene_id=null,$take=10,$type=1){
        if($scene_id!=null){
            $where=array(
                ['status',1],
                ['$scene_id',$scene_id],
                ['status',$type]
            );
        }else{
            $where=array(
                ['status',1],
                ['status',$type]
            );
        }
        $line = self::where($where)->take($take)->orderByDesc('sort')->get(['id','title','num','sort']);
        return $line;
    }
}